<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <title>药品价格明细</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
    
   
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>药品价格明细</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">采购目录管理</a></li>
            <li class="active"><a href="#">商品目录管理</a></li>
            <li class="active"><a href="#">配送关系管理</a></li>
            <li class="active"><a href="#">药品价格明细</a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class="form-inline">
                    <div class="form-group form-group-xs">
                       &nbsp;&nbsp;&nbsp; <label for="txtDrugForm">药品编码：</label>
                        <input class="form-control" type="text" id="drugCode" name="drugCode" placeholder="药品编码" ></input>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">&nbsp;&nbsp;通用名：</label>
                        <input class="form-control" type="text" id="drugName" id="drugName" placeholder="通用名" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">&nbsp;&nbsp;剂型：</label>
                        <input class="form-control" type="text" id="formName" id="formName" placeholder="剂型" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">&nbsp;&nbsp;规格：</label>
                        <input class="form-control" type="text" id="specName" id="specName" placeholder="规格" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">&nbsp;&nbsp;转换系数：</label>
                        <input class="form-control" type="text" id="factor" id="factor" placeholder="转换系数" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">&nbsp;&nbsp;单位：</label>
                        <input class="form-control" type="text" id="unit" id="unit" placeholder="单位" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">&nbsp;&nbsp;采购价：</label>
                        <input class="form-control" type="text" id="proPriceLimitText" id="proPriceLimitText" placeholder="采购价" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">&nbsp;&nbsp;最高零售价：</label>
                        <input class="form-control" type="text" id="retailPriceLimitText" id="retailPriceLimitText" placeholder="最高零售价" />
                    </div>
                    
                    <button type="button"  onclick="gridSerch()"  class="btn btn-success btn-sm">查&nbsp;询</button>
                </div>
            </div>
        </div>
         
        <table class="jqgrid" id="list4"></table>
        <div id="prowed2"></div>
         <div class=" box box-warning bottongroup" id="bottongroup">
            <label  onclick="window.location.href='${ctx}/baseDel/toBaseDelByCentreListSee.html'"   class="btn btn-default btn-sm" >返 回</label>
        </div>
            
        <div class="modal fade" id="selectComp" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
           
        </div>
  
   
</section>
<%@ include file="/WEB-INF/component/commonJS.jsp"%>
<script type="text/javascript">


$(function () {
jQuery("#list4").jqGrid({
    url: "getBaseDelByCentreGoods.html",
    mtype: "POST",
    datatype: "json",
    autowidth: true,
    multiselect:true,
    height: 250,
    colNames:['id','商品编码','药品编码','通用名','剂型','规格','转换系数','单位','采购价','最高零售价',"drugId"],
    colModel:[
        {name:'delRelId',index:'delRelId',key:true,hidden:true, width:10, sorttype:"date", align:"center"},
        {name:'goodsCode',index:'goodsCode',key:true,hidden:true, width:80, sorttype:"date", align:"center"},
        {name:'drugCode',index:'drugCode', width:100, sorttype:false, align:"center",
        	formatter:function(cellvalue, options, row){
        		return "<a href='${pageContext.request.contextPath}/stdDrug/drugInfoDetail.html?drugId="+row.drugId+"'>"+cellvalue+"</a>"
        				}
        },
        {name:'drugName',index:'drugName', width:80, sorttype:false, align:"center"},
        {name:'formName',index:'formName', width:60, align:"center"},
        {name:'specName',index:'specName', width:80, align:"center",sorttype:false},
        {name:'factor',index:'factor', width:60, align:"center",sorttype:false},
        {name:'unit',index:'unit', width:60, align:"center",sorttype:false},
        {name:'proPriceLimitText',index:'proPriceLimitText', width:60, align:"center",sorttype:false},
        {name:'retailPriceLimitText',index:'retailPriceLimitText', width:60, align:"center",sorttype:false},
        {name:'drugId',index:'drugId',key:true,hidden:true, width:10, sorttype:"date", align:"center"}
    ],
     rowNum: 10,
     rowList: [10, 20, 30],
     rownumbers: true,
     multiselect: true,
     pager: "#prowed2",
     viewrecords: true,
     caption: "商品列表",
     editurl:"proPlanItemListHis.jsp",
     jsonReader: {
         repeatitems: false,
         id: "delRelId"
     }
    
});
     
    jQuery("#list4").jqGrid('navGrid',"prowed2",{edit:false,add:false,del:false});
    
});

function gridSerch() {
    var drugCode = $.trim($("#drugCode").val());
    var drugName = $.trim($("#drugName").val());
    var formName = $.trim($("#formName").val());
    var specName = $.trim($("#specName").val());
    var factor = $.trim($("#factor").val());
    var unit = $.trim($("#unit").val());
    var proPriceLimitText = $.trim($("#proPriceLimitText").val());
    var retailPriceLimitText = $.trim($("#retailPriceLimitText").val());
    
    $("#list4").jqGrid('setGridParam',{  
        datatype:'json',
        postData:{"drugCode":drugCode,
                "drugName":drugName,
                "formName":formName,
                "specName":specName,
                "factor":factor,
                "unit":unit,
                "proPriceLimitText":proPriceLimitText,
                "retailPriceLimitText":retailPriceLimitText
        }        
    }).trigger("reloadGrid"); //重新载入  
}

    
    
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = parent.window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return null;
    }
    if(getQueryString("username")=="root"){
        $("#bedata1").show();
        $("#allDelete1").show();
        $("#bedata2").show();
        $("#allDelete2").show();
        
    }else if(getQueryString("username")=="yy001"){
        document.getElementById("yy001").style.display="";
    }else if(getQueryString("username")=="ps001"){
        document.getElementById("ps001").style.display="";
    }
    function editPsComp() {
        $('#editPsComp').modal({
            keyboard : true
        });
    }

    
  
 
    
</script>
</body>
</html>